<template>
  <div>

	<myheader></myheader>

	<br /><br />

			<!--面包屑导航-->
			<Breadcrumb :datas="datas" ></Breadcrumb>

	

	<section class="featured-block text-center">
        <h1>检索结果：</h1>
		<div class="container" v-for="(item,index) in searchdata" :key='index'>
        	<div class="divider"></div>
            <p>商品名：{{ item.name }}</p>
            <p>描述：{{ item.desc}}</p>
            <p>价格：{{item.price}}</p>
            <p>关注数：{{item.flow}}</p>
            
		</div>
	</section>
	
	<footer class="footer">

		<div class="container">
			@v3u.cn
		</div>
		
		
	</footer>
    
  </div>
  
</template>


 
<script>

//导包
import myheader from './myheader.vue';
import{config,formatXml} from '../config.js'
export default {
  data () {
    return {
        msg: "这是一个变量",
        //声明面包屑变量
        datas:[{title:'首页',route:{name:'index'}},{title:'商品检索'}],
        searchdata:[],
        
    }   
  },
  //注册组件标签
  components:{

  		'myheader':myheader

  },
  mounted:function(){

    //接收参数
    var word = this.$route.query.word;
    this.word=word
    console.log(this.word)
    this.get_searchdata();
},  
methods:{
    get_searchdata:function(){
		this.axios.get('http://127.0.0.1:8000/goodssearch/',{params:{'word':this.word}}).then((result)=>{
        console.log(result)
        this.searchdata = result.data
        

		})
  

    }

  }
}


</script>
 
<style>



</style>